Skip to content

Add Swagger UI API documentation with OpenAPI 3.0#25

Draft
Copilot wants to merge 2 commits into
masterfrom
copilot/add-api-documentation-tool
Draft

Add Swagger UI API documentation with OpenAPI 3.0#25
Copilot wants to merge 2 commits into
masterfrom
copilot/add-api-documentation-tool

Conversation

Copy link
Copy Markdown

Copilot AI commented Jan 2, 2026

Implements interactive API documentation using Swagger UI to replace manual documentation maintenance. All v2 API endpoints are now self-documented through JSDoc annotations.

Changes

  • Swagger Integration: Added /api-docs endpoint serving Swagger UI with OpenAPI 3.0 spec
  • API Annotations: Documented 16 endpoints across ships, turrets, kills, galaxypedia, guild config, and game constants
  • Security Schemes: Defined token authentication via x-token header and query parameter
  • Component Schemas: Reusable definitions for Ship, Turret, Kill, GuildConfig, and Error types

Implementation

OpenAPI spec generated from JSDoc comments in route handlers:

/**
 * @openapi
 * /v2/ships:
 *   post:
 *     summary: Update ship stats
 *     tags: [Ships]
 *     security:
 *       - ApiToken: []
 *     requestBody:
 *       required: true
 *       content:
 *         application/json:
 *           schema:
 *             type: object
 *     responses:
 *       200:
 *         description: Ships updated successfully
 */

Swagger UI route configured before authentication middleware to allow public access to documentation.

Access

Documentation available at /api-docs when server is running.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • checkpoint.prisma.io
    • Triggering command: /usr/local/bin/node /usr/local/bin/node /home/REDACTED/work/Galaxy-Info-v2/Galaxy-Info-v2/server/node_modules/prisma/build/child {"product":"prisma","version":"6.6.0","cli_install_type":"local","information":"","local_timestamp":"2026-01-02T16:18:07Z","project_hash":"f62ce0e9","cli_path":"/home/REDACTED/work/Galaxy-Info-v2/Galaxy-Info-v2/server/node_modules/.bin/prisma","cli_path_has (dns block)
    • Triggering command: /usr/local/bin/node /usr/local/bin/node /home/REDACTED/work/Galaxy-Info-v2/Galaxy-Info-v2/server/node_modules/prisma/build/child {"product":"prisma","version":"6.6.0","cli_install_type":"local","information":"","local_timestamp":"2026-01-02T16:18:08Z","project_hash":"f62ce0e9","cli_path":"/home/REDACTED/work/Galaxy-Info-v2/Galaxy-Info-v2/server/node_modules/.bin/prisma","cli_path_has (dns block)
  • wiki.galaxy.casa
    • Triggering command: /usr/local/bin/node node /home/REDACTED/work/Galaxy-Info-v2/Galaxy-Info-v2/server/node_modules/.bin/jest (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>API Documentation</issue_title>
<issue_description>Now that the project is open source, we really need to have good api documentation. There's two ways I see of doing this:

  • Manually writing documentation for every api endpoint and keeping it up to date (bad idea)
  • Using a tool like Swagger UI (Documentation), or something similar, to manage api documentation (recommended)

Link to swaggymania (Documentation)</issue_description>

Comments on the Issue (you are @copilot in this section)

@cswimr good question we should check this @Wingysam I believe it does.

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: Wingysam <18403742+Wingysam@users.noreply.github.com>
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Jan 2, 2026

Deploying galaxy-info-v2 with  Cloudflare Pages  Cloudflare Pages

Latest commit: 2c7265b
Status: ✅  Deploy successful!
Preview URL: https://366be75c.galaxy-info-v2.pages.dev
Branch Preview URL: https://copilot-add-api-documentatio.galaxy-info-v2.pages.dev

View logs

Copilot AI changed the title [WIP] Add API documentation with Swagger UI Add Swagger UI API documentation with OpenAPI 3.0 Jan 2, 2026
Copilot AI requested a review from Wingysam January 2, 2026 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

API Documentation

2 participants